
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="main">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加老师</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>
<script type="text/javascript" src="editor/kindeditor.js"></script>
<script type="text/javascript">
	KE.show({
		id : 'content7',
		cssPath : './index.css'
	});
</script>

<script type="text/javascript">
	$(document).ready(function(e) {
		$(".select1").uedSelect({
			width : 345
		});
		$(".select2").uedSelect({
			width : 167
		});
		$(".select3").uedSelect({
			width : 100
		});
	});
</script>
</head>
<body layout:fragment="content">
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="/ordering/home">首页</a></li>
			<li><a href="#">增加学生</a></li>
		</ul>
	</div>
	<div class="formbody">
		<div id="usual1" class="usual">
			<div class="itab">
				<ul>
					<li><a href="#tab1" class="selected">增加学生</a></li>
				</ul>
			</div>
			<form id="addForm" action="addStudent" method="post"
				enctype="multipart/form-data" name="form1">
				<div id="tab1" class="tabson">
					<!-- <div class="formtext">
						Hi，<b th:text="${session.user.name}">admin</b>，欢迎您使用增加商品功能！
					</div> -->
					<ul class="forminfo">
						<!-- <li><label>店铺图片<b>*</b></label><input name="file" id = "imgfile" type="file" style="width:518px;"/></li> -->
						<li><label>名称<b>*</b></label><input name="name" type="text"
							class="dfinput" style="width: 518px;" /></li>
						<li><label>手机<b>*</b></label><input name="mobile"
							placeholder="请填写11位手机号码，如：13553192985" type="text"
							class="dfinput" style="width: 518px;" /></li>
						<li><label>密码<b>*</b></label><input name="password"
							type="text" placeholder="请填写正确的电话号码，如：0531-1234567"
							class="dfinput" style="width: 518px;" /></li>
						<li><label>性别<b>*</b></label> 
							<label> <input type="radio" name="sex" value="1" checked="checked"/>&nbsp;&nbsp;男</label> 
							<label> <input type="radio" name="sex" value="0" />&nbsp;&nbsp;女</label></li>
						<li><label>年龄<b>*</b></label><input name="age" type="text"
							placeholder="请填写正确的电话号码，如：0531-1234567" class="dfinput"
							style="width: 518px;" /></li>
						<li><label>学校下拉框<b>*</b></label> <select th:name="school.id"
							class="dfinput" style="width: 518px;">
								<option value="">--option--</option>
								<option th:each="school : ${schools.list}"
									th:value="${school.id}" th:text="${school.name}">option</option>
						</select></li>
						<li><label>年级下拉框<b>*</b></label> <select th:name="grade.id"
							class="dfinput" style="width: 518px;">
								<option value="">--option--</option>
								<option th:each="grade : ${grades.list}" th:value="${grade.id}"
									th:text="${grade.name}">option</option>
						</select></li>
						<li><label>班级下拉框<b>*</b></label> <select th:name="clazz.id"
							class="dfinput" style="width: 518px;">
								<option value="">--option--</option>
								<option th:each="clazz : ${clazzs.list}" th:value="${clazz.id}"
									th:text="${clazz.name}">option</option>
						</select></li>
						<li><label>&nbsp;</label><input id="goForm" type="button"
							class="btn" value="增加" /></li>
					</ul>
				</div>
			</form>
		</div>

		<script type="text/javascript">
			$("#goForm").click(function() {
				$("#addForm").submit();
			});
			/* $("#usual1 ul").idTabs(); 
			$("#goForm").click(function(){
				if($("#imgfile").val()!=""){
					var size = $("#imgfile")[0].files[0].size;
			    	if (size>1048576) 
					{
						alert("选择的图片不能大于1M，请重新选择!");
						return false;
					}
			    	var location=$("input[name='file']").val(); 
			        var point = location.lastIndexOf("."); 
			        var type = location.substr(point); 
			        if(type!=".jpg"&&type!=".jpeg"&&type!=".png"){ 
			        	alert("只允许上传图片(.jpg/.jpeg/.png)，请重新选择！");
						return false;       
			        }
				}
				if (document.form1.name.value == "" ) 
				{
					alert("请填写商铺名称!");
					document.form1.name.focus();
					return false;
				}
				var m =/^0?1[3|4|5|8|7][0-9]\d{8}$/;
				if (!m.exec(document.form1.mobile.value) ) 
				{
					alert("请填写正确手机号码!");
					document.form1.mobile.focus();
					return false;
				}
				var t = /^0\d{2,3}-?\d{7,8}$/;
			    	if (!t.exec(document.form1.phone.value) ) 
					{
						alert("请填写正确电话号码!");
						document.form1.phone.focus();
						return false;
					}
			    	var p =/^([1-9][0-9]*)$/;
			    	if (!p.exec(document.form1.qq.value) ) 
					{
						alert("请填写正确qq号码!");
						document.form1.qq.focus();
						return false;
					}
			    	if (document.form1.address.value == "" ) 
					{
						alert("请填写商铺地址!");
						document.form1.address.focus();
						return false;
					}
			    	if (document.form1.textDescription.value == "" ) 
					{
						alert("请填写商铺简介!");
						document.form1.textDescription.focus();
						return false;
					}
				var values=$("#textDescription").val();
				$("#description").val(values);
				$("#addForm").submit();
			});
			$('.tablelist tbody tr:odd').addClass('odd'); */
		</script>
	</div>
</body>
</html>
